﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;

namespace Loki.Model
{
	/// <summary>
	/// Index configuration for entity container
	/// </summary>
	/// <typeparam name="TEntityClass">Entity class type</typeparam>
	public class IndexConfiguration<TEntityClass, TKey> : IIndexConfiguration<TEntityClass>
	{
		/// <summary>
		/// Gets or sets the indexed property selector.
		/// </summary>
		/// <value>
		/// The selector.
		/// </value>
		public Expression<Func<TEntityClass, object>> Indexer
		{
			get;
			set;
		}

		/// <summary>
		/// Gets or sets the index specific loader.
		/// </summary>
		/// <value>The loader.</value>
		public Func<object, IEnumerable<TEntityClass>> Loader
		{
			get;
			set;
		}

		/// <summary>
		/// Gets or sets the index comparer
		/// </summary>
		public IEqualityComparer<TKey> IndexComparer
		{
			get;
			set;
		}
	}
}
